//
//  ViewController.m
//  UI07_DCIMHomework
//
//  Created by dllo on 16/6/14.
//  Copyright © 2016年 司昌宝. All rights reserved.
//

#import "ViewController.h"
#import "UIDcimView.h"
#import "SecondViewController.h"
@interface ViewController ()<UIDcimViewDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self createView];
    
    
}
-(void)createView{
    
    NSMutableArray *nameArray = [NSMutableArray arrayWithCapacity:6];
    
    for (NSInteger i = 1;i <= 6; i++) {
        NSString *name = [NSString stringWithFormat:@"cat_%ld.jpg",i];
        [nameArray addObject:name];
    }
    
    UIDcimView *dcimView = [[UIDcimView alloc] initWithFrame:[UIScreen mainScreen].bounds withNameArray:nameArray];
    [self.view addSubview:dcimView];
    
    dcimView.delegate = self;
    
    [dcimView release];
}

-(void)nextViewControllerWith:(NSInteger)Index{
    SecondViewController *svc = [[SecondViewController alloc] init];
    svc.index = Index;
    [self.navigationController pushViewController:svc animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
